-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce a new extension for generating Dockerfiles #42316
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
ad21261
to
1866652
Compare
This comment has been minimized.
This comment has been minimized.
1866652
to
4092aca
Compare
This comment has been minimized.
This comment has been minimized.
4092aca
to
afcb767
Compare
This comment has been minimized.
This comment has been minimized.
afcb767
to
8b617f8
Compare
This comment has been minimized.
This comment has been minimized.
8b617f8
to
7ffcce4
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good over all, I spotted only micro issues.
Not sure who would have the time to test this one. @maxandersen do you have somebody in mind?
...les/deployment/src/main/java/io/quarkus/dockerfiles/deployment/DockerfilesConfiguration.java
Outdated
Show resolved
Hide resolved
extensions/dockerfiles/runtime/src/main/resources/META-INF/quarkus-extension.yaml
Outdated
Show resolved
Hide resolved
Hey @iocanel . The feature freeze for 3.14 and 3.15 LTS is next Tuesday so we should really try to finalize this as it's an awesome feature. Someone asked about it here #42441 and I was thinking of asking them to test but... we need instructions on how to install it as I don't think it comes by default? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some additional comments that need fixing.
I saw you asked for a review by @maxandersen and @cescoffier anyway so I will let it there until they have time to review it.
...les/deployment/src/main/java/io/quarkus/dockerfiles/deployment/DockerfilesConfiguration.java
Outdated
Show resolved
Hide resolved
...les/deployment/src/main/java/io/quarkus/dockerfiles/deployment/DockerfilesConfiguration.java
Outdated
Show resolved
Hide resolved
...les/deployment/src/main/java/io/quarkus/dockerfiles/deployment/DockerfilesConfiguration.java
Outdated
Show resolved
Hide resolved
I'm also wondering if in the future we should generate the default Dockerfiles from there to be consistent. |
@iocanel any reason not to continue on what you started with codestarts? |
It should be possible to share the same templates as the existing codestarts and use a subset part of the codestart generator for generation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may have missed something but where extensions can add packages and files to the generated docker files?
So far I only see the "from" customization.
What I had in my mind is to deal with just #41772 and leave the rest for future prs. If you feel that this needs to be done in one go, please let me know. |
7ffcce4
to
ab5590e
Compare
This comment has been minimized.
This comment has been minimized.
ab5590e
to
95984d7
Compare
🎊 PR Preview a98fb44 has been successfully built and deployed to https://quarkus-pr-main-42316-preview.surge.sh/version/main/guides/
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@iocanel Where are we on this? |
...eployment/src/main/java/io/quarkus/deployment/builditem/SetClassPathSystemPropBuildItem.java
Outdated
Show resolved
Hide resolved
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my case it was a problem to have CLI be a quarkus app. Check you can build from scratch.
import picocli.CommandLine.Parameters; | ||
|
||
@TopCommand | ||
@Command(name = "dockerfiles", sortOptions = false, mixinStandardHelpOptions = false, header = "Generate Dockerfiles.", headerHeading = "%n", commandListHeading = "%nCommands:%n", synopsisHeading = "%nUsage: ", optionListHeading = "%nOptions:%n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Command(name = "dockerfiles", sortOptions = false, mixinStandardHelpOptions = false, header = "Generate Dockerfiles.", headerHeading = "%n", commandListHeading = "%nCommands:%n", synopsisHeading = "%nUsage: ", optionListHeading = "%nOptions:%n") | |
@Command(name = "dockerfiles", sortOptions = false, mixinStandardHelpOptions = false, header = "Generate Dockerfiles/Containerfiles.", headerHeading = "%n", commandListHeading = "%nCommands:%n", synopsisHeading = "%nUsage: ", optionListHeading = "%nOptions:%n") |
@Option(names = { "--native" }, paramLabel = "", order = 5, description = "Flag to enable Native Dockerfile generation") | ||
boolean generateNativeDockerfile; | ||
|
||
@Parameters(arity = "0..1", paramLabel = "GENERATION_PATH", description = " The path to generate Dockerfiles") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Parameters(arity = "0..1", paramLabel = "GENERATION_PATH", description = " The path to generate Dockerfiles") | |
@Parameters(arity = "0..1", paramLabel = "GENERATION_PATH", description = "The path to generate Dockerfiles") |
private static final ArtifactDependency QUARKUS_DOCKERFILES_SPI = new ArtifactDependency("io.quarkus", | ||
"quarkus-dockerfiles-spi", null, "jar", Dockerfiles.getVersion()); | ||
|
||
@Option(names = { "--jvm" }, paramLabel = "", order = 5, description = "Flag to enable JVM Dockerfile generation") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it generate all the variants or a single one (in this case, which one?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it doesn't. By default a jvm Dockerfile will be generated, unless the user implies native by option or Dockerfile suffix.
In such cases this option is available to also generate a jvm file:
- No options -> Jvm
- Native options -> Native
- Native options + Jvm Options -> Native + Jvm
@iocanel ping. |
I'll get back to it this week |
@iocanel Hey! Gently "happy new year" reminder :-) |
I am now back at it. |
59ded5f
to
13b326a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
13b326a
to
fb049e5
Compare
Status for workflow
|
Status for workflow
|
Status | Name | Step | Failures | Logs | Raw logs | Build scan |
---|---|---|---|---|---|---|
✖ | Native Tests - Misc4 | Build |
Failures | Logs | Raw logs | 🔍 |
Full information is available in the Build summary check run.
You can consult the Develocity build scans.
Failures
⚙️ Native Tests - Misc4 #
- Failing: integration-tests/gradle
📦 integration-tests/gradle
✖ io.quarkus.gradle.nativeimage.BasicJavaNativeBuildIT.shouldBuildNativeImage
- History - More details - Source on GitHub
java.lang.AssertionError: Gradle build failed with exit code 137
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:140)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:57)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:52)
at app//io.quarkus.gradle.nativeimage.QuarkusNativeGradleITBase.runGradleWrapper(QuarkusNativeGradleITBase.java:36)
at app//io.quarkus.gradle.nativeimage.BasicJavaNativeBuildIT.shouldBuildNativeImage(BasicJavaNativeBuildIT.java:24)
at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
✖ io.quarkus.gradle.nativeimage.BasicJavaNativeBuildIT.shouldBuildNativeImageWithCustomName
- History - More details - Source on GitHub
java.lang.AssertionError: Gradle build failed with exit code 137
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:140)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:57)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:52)
at app//io.quarkus.gradle.nativeimage.QuarkusNativeGradleITBase.runGradleWrapper(QuarkusNativeGradleITBase.java:36)
at app//io.quarkus.gradle.nativeimage.BasicJavaNativeBuildIT.shouldBuildNativeImageWithCustomName(BasicJavaNativeBuildIT.java:53)
at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
✖ io.quarkus.gradle.nativeimage.BasicJavaNativeBuildIT.shouldBuildNativeImageWithCustomNameWithoutSuffix
- History - More details - Source on GitHub
java.lang.AssertionError: Gradle build failed with exit code 137
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:140)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:57)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:52)
at app//io.quarkus.gradle.nativeimage.QuarkusNativeGradleITBase.runGradleWrapper(QuarkusNativeGradleITBase.java:36)
at app//io.quarkus.gradle.nativeimage.BasicJavaNativeBuildIT.shouldBuildNativeImageWithCustomNameWithoutSuffix(BasicJavaNativeBuildIT.java:84)
at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
✖ io.quarkus.gradle.nativeimage.CustomNativeTestSourceSetIT.runNativeTests
- History - More details - Source on GitHub
java.lang.AssertionError: Gradle build failed with exit code 137
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:140)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:57)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:52)
at app//io.quarkus.gradle.nativeimage.QuarkusNativeGradleITBase.runGradleWrapper(QuarkusNativeGradleITBase.java:36)
at app//io.quarkus.gradle.nativeimage.CustomNativeTestSourceSetIT.runNativeTests(CustomNativeTestSourceSetIT.java:17)
at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
✖ io.quarkus.gradle.nativeimage.NativeIntegrationTestIT.nativeTestShouldRunIntegrationTest
- History - More details - Source on GitHub
java.lang.AssertionError: Gradle build failed with exit code 137
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:140)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:57)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:52)
at app//io.quarkus.gradle.nativeimage.QuarkusNativeGradleITBase.runGradleWrapper(QuarkusNativeGradleITBase.java:36)
at app//io.quarkus.gradle.nativeimage.NativeIntegrationTestIT.nativeTestShouldRunIntegrationTest(NativeIntegrationTestIT.java:24)
at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
✖ io.quarkus.gradle.nativeimage.NativeIntegrationTestIT.runNativeTestsWithOutputName
- History - More details - Source on GitHub
java.lang.AssertionError: Gradle build failed with exit code 137
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:140)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:57)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:52)
at app//io.quarkus.gradle.nativeimage.QuarkusNativeGradleITBase.runGradleWrapper(QuarkusNativeGradleITBase.java:36)
at app//io.quarkus.gradle.nativeimage.NativeIntegrationTestIT.runNativeTestsWithOutputName(NativeIntegrationTestIT.java:35)
at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
✖ io.quarkus.gradle.nativeimage.NativeIntegrationTestIT.runNativeTestsWithoutRunnerSuffix
- History - More details - Source on GitHub
java.lang.AssertionError: Gradle build failed with exit code 137
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:140)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:57)
at app//io.quarkus.gradle.QuarkusGradleWrapperTestBase.runGradleWrapper(QuarkusGradleWrapperTestBase.java:52)
at app//io.quarkus.gradle.nativeimage.QuarkusNativeGradleITBase.runGradleWrapper(QuarkusNativeGradleITBase.java:36)
at app//io.quarkus.gradle.nativeimage.NativeIntegrationTestIT.runNativeTestsWithoutRunnerSuffix(NativeIntegrationTestIT.java:45)
at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
Flaky tests - Develocity
⚙️ JVM Tests - JDK 21
📦 extensions/smallrye-reactive-messaging/deployment
✖ io.quarkus.smallrye.reactivemessaging.hotreload.ConnectorChangeTest.testUpdatingConnector
- History
Expecting actual: ["-4","-5","-6","-7","-8","-9","-10","-11"] to start with: ["-3", "-4", "-5", "-6"]
-java.lang.AssertionError
java.lang.AssertionError:
Expecting actual:
["-4","-5","-6","-7","-8","-9","-10","-11"]
to start with:
["-3", "-4", "-5", "-6"]
at io.quarkus.smallrye.reactivemessaging.hotreload.ConnectorChangeTest.testUpdatingConnector(ConnectorChangeTest.java:36)
Updates:
quarkus-dockerfiles
as dependency